package com.hunter.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.hunter.robot.KeyBoarRobot;
import com.hunter.robot.NewMouseRobot;
import lombok.extern.slf4j.Slf4j;
import javax.swing.*;

/**
 *@Project:iwms
 *@Description: 文本框监视
 *@Author: Mr.Hunter
 *@Date:2022/5/16/14:05
 */
@Slf4j
public class TextFieldActionListenter  implements ActionListener {
    private String oTextField;
    private JTextField xTextField;
    private JTextField yTextField;

    public TextFieldActionListenter(JTextField xTextField, JTextField yTextField) {
        this.xTextField = xTextField;
        this.yTextField = yTextField;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
            oTextField = e.getActionCommand();
            log.info("x,y" + xTextField.getText() + "   " + yTextField.getText());
            log.info("订单号:" + oTextField);
            NewMouseRobot mouseRobot1 = new NewMouseRobot();
            mouseRobot1.XY(xTextField.getText(), yTextField.getText());
            KeyBoarRobot keyBoarRobot = new KeyBoarRobot();
            keyBoarRobot.Zh(oTextField);
    }
}
